package com.resource.authoritymanage.config;


import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;
import java.util.Optional;

@Getter
@AllArgsConstructor
public enum AuditMeanEnum {

    PASSED("1","通过"),
    UNPASSED("2","不通过");


    private String code;
    private String name;


    public static String parseName(String code){
        Optional<String> optional = Arrays.stream(values()).filter(item -> Objects.equals(code, item.getCode())).findFirst()
                .map(item -> item.getName());
        return optional.isPresent() ? optional.get() : null;}
}
